Optimal. Leaf size=61 \[ -\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {3 i a^3 \sec (c+d x)}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {3577, 3567,
3855} \begin {gather*} -\frac {3 i a^3 \sec (c+d x)}{d}-\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3567
Rule 3577
Rule 3855
Rubi steps
\begin {align*} \int \cos (c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d}-\left (3 a^2\right ) \int \sec (c+d x) (a+i a \tan (c+d x)) \, dx\\ &=-\frac {3 i a^3 \sec (c+d x)}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d}-\left (3 a^3\right ) \int \sec (c+d x) \, dx\\ &=-\frac {3 a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {3 i a^3 \sec (c+d x)}{d}-\frac {2 i a \cos (c+d x) (a+i a \tan (c+d x))^2}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(123\) vs. \(2(61)=122\).
time = 0.57, size = 123, normalized size = 2.02 \begin {gather*} \frac {a^3 \cos ^2(c+d x) \left (6 \tanh ^{-1}\left (\sin (c)+\cos (c) \tan \left (\frac {d x}{2}\right )\right ) \cos (c+d x) (i \cos (3 c)+\sin (3 c))+(-\cos (2 c-d x)+i \sin (2 c-d x)) (5 \cos (c+d x)-i \sin (c+d x))\right ) (-i+\tan (c+d x))^3}{d (\cos (d x)+i \sin (d x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 97, normalized size = 1.59
method | result | size |
risch | \(-\frac {4 i a^{3} {\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {2 i {\mathrm e}^{i \left (d x +c \right )} a^{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {3 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(93\) |
derivativedivides | \(\frac {-i a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )-3 a^{3} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 i a^{3} \cos \left (d x +c \right )+\sin \left (d x +c \right ) a^{3}}{d}\) | \(97\) |
default | \(\frac {-i a^{3} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )-3 a^{3} \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 i a^{3} \cos \left (d x +c \right )+\sin \left (d x +c \right ) a^{3}}{d}\) | \(97\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 82, normalized size = 1.34 \begin {gather*} -\frac {2 i \, a^{3} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + 3 \, a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} + 6 i \, a^{3} \cos \left (d x + c\right ) - 2 \, a^{3} \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 107, normalized size = 1.75 \begin {gather*} \frac {-4 i \, a^{3} e^{\left (3 i \, d x + 3 i \, c\right )} - 6 i \, a^{3} e^{\left (i \, d x + i \, c\right )} - 3 \, {\left (a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) + 3 \, {\left (a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.20, size = 107, normalized size = 1.75 \begin {gather*} - \frac {2 i a^{3} e^{i c} e^{i d x}}{d e^{2 i c} e^{2 i d x} + d} + \frac {3 a^{3} \left (\log {\left (e^{i d x} - i e^{- i c} \right )} - \log {\left (e^{i d x} + i e^{- i c} \right )}\right )}{d} + \begin {cases} - \frac {4 i a^{3} e^{i c} e^{i d x}}{d} & \text {for}\: d \neq 0 \\4 a^{3} x e^{i c} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 234 vs. \(2 (55) = 110\).
time = 0.78, size = 234, normalized size = 3.84 \begin {gather*} \frac {63 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 63 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 128 i \, a^{3} e^{\left (3 i \, d x + 3 i \, c\right )} - 192 i \, a^{3} e^{\left (i \, d x + i \, c\right )} + 63 \, a^{3} \log \left (i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) - 33 \, a^{3} \log \left (i \, e^{\left (i \, d x + i \, c\right )} - 1\right ) - 63 \, a^{3} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} + 1\right ) + 33 \, a^{3} \log \left (-i \, e^{\left (i \, d x + i \, c\right )} - 1\right )}{32 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.64, size = 102, normalized size = 1.67 \begin {gather*} -\frac {6\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {8\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,2{}\mathrm {i}-10\,a^3}{d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,1{}\mathrm {i}+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________